// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';

class ProfilePages extends StatelessWidget {
  ProfilePages({super.key});

  final TextEditingController _phoneController = TextEditingController();
  final TextEditingController _passwordController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text('Profile'),
      ),
      body: Container(
        padding: EdgeInsets.all(6),
        margin: EdgeInsets.all(8),
        decoration: BoxDecoration(
            border: Border.all(
              color: Colors.black,
            ),
            borderRadius: BorderRadius.all(Radius.circular(3))),
        child: Column(children: [
          Image.asset(
            "assets/ic_call.png",
            width: 16,
          ),
          TextField(
            controller: _phoneController,
            decoration: InputDecoration(
              hintText: '手机号',
            ),
            keyboardType: TextInputType.phone,
            textInputAction: TextInputAction.next,
          ),
          TextField(
            controller: _passwordController,
            decoration: InputDecoration(
                hintText: '密码',
                // border: InputBorder.none,
                enabledBorder: UnderlineInputBorder(
                  borderSide: BorderSide(color: Colors.grey, width: 0.2),
                ),
                focusedBorder: UnderlineInputBorder(
                  borderSide: BorderSide(color: Colors.red, width: 0.2),
                )),
            keyboardType: TextInputType.text,
            textInputAction: TextInputAction.done,
            style: TextStyle(color: Colors.green),
            obscureText: true,
          ),
          Padding(
            padding: EdgeInsets.all(12),
            child: ElevatedButton(
                onPressed: () => {
                      Navigator.pushNamed(context, "LoginPages", arguments: {
                        'phone': _phoneController.text,
                        'password': _passwordController.text
                      })
                    },
                child: Text('Login')),
          )
        ]),
      ),
    );
  }
}
